package com.learner.exam.controller;

import com.learner.exam.service.ExamQuestionService;
import com.learner.pojo.exam.ExamQuestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author linweibing
 * @date 2023-03-11 0:52
 * @description: TODO
 */
@RestController
@RequestMapping("/api/exam/exam_question")
public class ExamQuestionController {

    @Autowired
    ExamQuestionService examQuestionService;

    /**
     * 根据考试id获取题目
     *
     * @param examId 考试id
     * @return ExamQuestion
     */
    @GetMapping("/getExamQuestionByExamId/{examId}")
    public ExamQuestion getExamQuestionByExamId(@PathVariable("examId") Integer examId) {
        return examQuestionService.getExamQuestionByExamId(examId);
    }
}
